FROM golang AS build-env
ADD . /go/src/app
ENV GOPROXY=https://goproxy.cn
WORKDIR /go/src/app
# RUN go get -u -v github.com/gin-gonic/gin
RUN GOOS=linux GOARCH=amd64 go build -v -o /go/src/app/app-server

FROM ubuntu
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
COPY --from=build-env /go/src/app/app-server /usr/local/bin/app-server
EXPOSE 8080
CMD [ "/usr/local/bin/app-server" ]